<?php require_once('../conn/DBconnect.php'); 
	require_once('../utils/phpUtils.php');

	$reportSQL = "call SP_REPORT('REG_LIST_SUMMARY','','');";
	
	if ($result = mysqli_query($mysqlLink, $reportSQL)) {
		
		$xml = simplexml_load_string("<?xml version='1.0' encoding='utf-8'?><records/>");
		
		//foreach( $result as $obj )
		//{
		//	$node = $xml->addChild("dataNode");
		//	ArrayToXML::toXml($obj, "dataNode", $node);
		//}
	   // $processedResult = array();

	    while($row = mysqli_fetch_object($result))
	    {
	    	$node = $xml->addChild('dataNode');
			ArrayToXML::toXml($row, 'dataNode', $node);
	    }
	
	   // return $processedResult;
		print $xml->asXML();
	}
	else
		echo "Unknown error";

?>
